package cn.billy.org.domain;

import cn.billy.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BaseDomain {


        private String sn;
        private String name;
        private String dirPath;
        private Integer state;
        private Long managerId;
        private Long parentId;

        private Employee manager;
        private Department department;
        @JsonInclude(JsonInclude.Include.NON_EMPTY)
        private List<Department> children = new ArrayList<>();

        @Override
        public String toString() {
                return "Department{" +
                        "id=" + id +
                        ", sn='" + sn + '\'' +
                        ", name='" + name + '\'' +
                        ", dirPath='" + dirPath + '\'' +
                        ", state=" + state +
                        ", manager_id=" + managerId +
                        ", parent_id=" + parentId +
                        ", manager=" + manager +
                        ", department=" + department +
                        ", children=" + children +
                        '}';
        }
}
